/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.fatecz.database;

import java.sql.Connection;
import java.sql.SQLException;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.sql.DataSource;

/**
 *
 * @author Vinicius
 */

public class ConnectionPool {
    
    private static DataSource ds;
    
    public static Connection getConnection() throws NamingException, SQLException{
        Connection conn;
        Context ctx = new InitialContext();
        ds = (DataSource) ctx.lookup("jdbc/fatecz");        
        conn = ds.getConnection();
        return conn;
    }    
}
